# include <iostream>
#include <cmath>

using namespace std;

int operate(int a,int b,int(* f)(int x,int y),int x1,int y1);
int f1(int x,int y);
int f2(int x,int y);
int f3(int x,int y);

int main ()
{
    int a,b,x,y,s;
    cout<<"enter the value of a,b,x,y"<<endl;
    cin>>a>>b>>x>>y;


    s=operate(a,b,f1,x,y)+operate(a,b,f2,x,y)+operate(a,b,f3,x,y);
    cout<<s<<endl;

    cin>>s;
    return 0;
}
int operate(int a,int b,int(* f)(int x,int y),int x1,int y1)
{
    int x,y;
    x=x1;y=y1;
    return a+b+f(x,y);
}

int f1(int x,int y)
{
    return x>y?x:y;
}

int f2(int x,int y)
{
    return x>y?0:1;
}

int f3(int x,int y)
{
    return x*y;
}